import UIKit
import Flutter

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    GeneratedPluginRegistrant.register(with: self)
    let controller:FlutterViewController = window.rootViewController as! FlutterViewController
    let channle = FlutterMethodChannel(name: "com.andy.test", binaryMessenger: controller.binaryMessenger)
    channle.setMethodCallHandler { (call, result) in
        //       platresult = await platform.invokeMethod(/*cell.method*/'setToken',/*cell.arguments*/"我是一个token",);
        if "sayHello" == call.method{
            result("jiangbin jiayou ")
        }
        else{
            result(FlutterMethodNotImplemented)
        }
    }
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}
